{php}
$error = false;
{/php}
<style>
.table-box{
    background-color: #fff;
    overflow: hidden;
    padding:15px;
}
</style>
<div class="table-box">
<form class="layui-form" action="{:url()}" method="post">
<div class="page-form">

    {if isset($formData['module_depend']) && $formData['module_depend']}
    <fieldset class="layui-elem-field layui-field-title">
        <legend>模块依赖检查</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-input-inline" style="width:800px;">
            <table class="layui-table ml30" lay-even="" lay-skin="row">
                <thead>
                <tr>
                    <th>依赖插件</th>
                    <th>插件标识</th>
                    <th>当前版本</th>
                    <th>需要版本</th>
                    <td>应用状态</td>
                    <th>结果</th>
                </tr>
                </thead>
                <tbody>
                {volist name="formData['module_depend']" id="v"}
                <tr>
                    <td>{$v[0]}</td>
                    <td>{$v[1]}</td>
                    <td>{$v[5]}</td>
                    <td>{$v[2]}</td>
                    <td>{if !empty($v[6])}{$v[6]}{else}未安装{/if}</td>
                    <td>{$v[4]|raw}</td>
                </tr>
                {if ($v[4] != '✔︎')}
                {php}
                $error = true;
                {/php}
                {/if}
                {/volist}
                </tbody>
            </table>
        </div>
    </div>
    {/if}
    {if isset($formData['plugin_depend']) && $formData['plugin_depend']}
    <fieldset class="layui-elem-field layui-field-title">
        <legend>插件依赖检查</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-input-inline" style="width:800px;">
            <table class="layui-table ml30" lay-even="" lay-skin="row">
                <thead>
                <tr>
                    <th>依赖插件</th>
                    <th>插件标识</th>
                    <th>当前版本</th>
                    <th>需要版本</th>
                    <td>应用状态</td>
                    <th>结果</th>
                </tr>
                </thead>
                <tbody>
                {volist name="formData['plugin_depend']" id="v"}
                <tr>
                    <td>{$v[0]}</td>
                    <td>{$v[1]}</td>
                    <td>{$v[5]}</td>
                    <td>{$v[2]}</td>
                    <td>{if !empty($v[6])}{$v[6]}{else}未安装{/if}</td>
                    <td>{$v[4]|raw}</td>
                </tr>
                {if ($v[4] != '✔︎')}
                {php}
                $error = true;
                {/php}
                {/if}
                {/volist}
                </tbody>
            </table>
        </div>
    </div>
    {/if}
    {if condition="$tables"}
    <fieldset class="layui-elem-field layui-field-title">
      <legend>数据库表检查</legend>
    </fieldset>
    <div class="layui-form-item">
        <div class="w400">
        <table class="layui-table ml30" lay-even="" lay-skin="row">
            <colgroup>
                <col >
                <col width="110">
            </colgroup>
            <thead>
                <tr>
                    <th>数据库表</th>
                    <th>结果</th>
                </tr> 
            </thead>
            <tbody>
                {volist name="tables" id="vo"}
                <tr>
                    <td>{$vo['table']}</td>
                    <td>{$vo['exist']|raw}</td>
                </tr>
                {/volist}
            </tbody>
        </table>
        </div>
    </div>
    {/if}
    <div class="layui-form-item">
        <label class="layui-form-label">清除旧数据</label>
        <div class="layui-input-inline">
            <input type="radio" name="clear" value="1" title="是" checked>
            <input type="radio" name="clear" value="0" title="否">
        </div>
        <div class="layui-form-mid layui-word-aux">
            选择“否”，不会删除已存在的数据表
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"> </label>
        <div class="layui-input-block">
            <input type="hidden" name="id" value="{$formData['id']}">
            <button type="submit" {if condition="$error"}class="layui-btn layui-btn-disabled" disabled{else /}class="layui-btn layui-btn-normal"{/if} lay-submit="" lay-filter="formSubmit">立即安装</button>
            <a href="{:url('index')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
        </div>
    </div>
</div>
</form>
</div>
{include file="block/layui" /}